#ifndef __CONFIG_H__
#define __CONFIG_H__

#include <string>
#include "sqlite3.h"

namespace verema
{
/**
 * \class Config
 *
 * \brief This class handels the config file access
 *
 * This class is implemented as a Singleton. There can always be only one object of this class
 */
class Config
{
private:
	std::string _lang;
	std::string _dbname;
	std::string _view;
	std::string _unit;
	std::string _subunit;
	std::string _item;

	void parseConfig();
	void writeConfig();

	static Config* instance;

	Config();
	Config(const Config& cc);
	~Config();

public:
	static Config* getInstance();
    static void destroy();

	std::string lang()    { return _lang; }
	void        lang(std::string);
	std::string dbname()  { return _dbname; }
	void        dbname(std::string);
	std::string view()    { return _view; }
	void        view(std::string);
	std::string unit()    { return _unit; }
	void        unit(std::string);
	std::string subunit() { return _subunit; }
	void        subunit(std::string);
	std::string item()    { return _item; }
	void        item(std::string);
};

} // namespace verema

#endif // __CONFIG_H__
